package com.mdd.service.auth;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.domain.AlipayFundAuthOperationDetailQueryModel;
import com.alipay.api.domain.AlipayFundAuthOrderAppFreezeModel;
import com.alipay.api.domain.AlipayFundAuthOrderUnfreezeModel;
import com.alipay.api.response.*;
import com.mdd.validate.AuthParams;
import com.mdd.validate.FreezeAppOrder;
import com.mdd.validate.FreezeCancelParams;
/**
 *
 * {@code @Description}
 * @Author 幻速
 * {@code @Date} 2023/10/30 15:07
 **/
public interface PreAuthorizationService {
    /**
     * 冻结资金
     * @param alipayFundAuthOrderAppFreezeModel 冻结信息
     * @return AlipayFundAuthOrderAppFreezeResponse
     */
    AlipayFundAuthOrderAppFreezeResponse aliPayFreeze(AlipayClient alipayClient, AlipayFundAuthOrderAppFreezeModel alipayFundAuthOrderAppFreezeModel, String notifyUrl) throws AlipayApiException;

    /**
     * 查询冻结
     * @param alipayFundAuthOperationDetailQueryModel 查询信息
     * @return AlipayFundAuthOperationDetailQueryResponse
     */
    AlipayFundAuthOperationDetailQueryResponse authQuery(AlipayClient alipayClient, AlipayFundAuthOperationDetailQueryModel alipayFundAuthOperationDetailQueryModel) throws AlipayApiException;

    /**
     * 预授权取消
     * @param freezeCancelParams
     * @return AlipayFundAuthOperationCancelResponse
     */
    AlipayFundAuthOperationCancelResponse authCancel(AlipayClient alipayClient,FreezeCancelParams freezeCancelParams) throws AlipayApiException;

    /**
     * 资金授权解冻
     * @param authParams
     * @return AlipayFundAuthOrderUnfreezeResponse
     */
    AlipayFundAuthOrderUnfreezeResponse unfreeze(AlipayClient alipayClient, AlipayFundAuthOrderUnfreezeModel model) throws AlipayApiException;

    /**
     * (线下)收银员通过收银台或商户后台调用支付宝接口，生成二维码后，展示给用户，由用户扫描二维码完成资金冻结
     */
    AlipayFundAuthOrderVoucherCreateResponse authVoucherCreate(AlipayClient alipayClient,FreezeAppOrder freezeAppOrder) throws AlipayApiException;

    /**
     * (线下)资金授权冻结接口
     * @param freezeAppOrder
     * @return
     */
    AlipayFundAuthOrderFreezeResponse authOrderFreeze(AlipayClient alipayClient,FreezeAppOrder freezeAppOrder,String notifyUrl) throws AlipayApiException;
}
